//
//  MTNavBarView.m
//  美团外卖
//
//  Created by Alex on 16/9/23.
//  Copyright © 2016年 Alex. All rights reserved.
//

#import "LBNavBarView.h"

@implementation LBNavBarView

- (void)drawRect:(CGRect)rect
{
    // 先画矩形
    UIBezierPath *rectPath = [UIBezierPath bezierPathWithRect:rect];
    
    // 设置颜色
    [[UIColor whiteColor]set];
    
    [rectPath fill];
    
    // 画线
    // 1 个点 --> 2 个像素 (4s, 5, 6)
    // 1 个点 --> 3 个像素
    CGFloat lineHeight = 1 / [UIScreen mainScreen].scale;
    
    CGFloat lineY = rect.size.height - lineHeight;
    UIBezierPath *linePath = [UIBezierPath bezierPath];
    
    [linePath moveToPoint:CGPointMake(0, lineY)];
    
    [linePath addLineToPoint:CGPointMake(rect.size.width, lineY)];
    
    // 设置线的颜色
    [[UIColor redColor] set];
    
    [linePath stroke];

}
@end
